import VueRouter from "vue-router";
import IndexMain from "../components/IndexMain.vue"
import ReadNews from '../components/ReadNews.vue'
import UserRegister from '../components/UserRegister.vue'
import NewsManager from '../components/NewsManager.vue'
import NewsAdd from '../components/NewsAdd.vue'
import NewsEdit from '../components/NewsEdit.vue'
import TopicManager from '../components/TopicManager.vue'

const router = new VueRouter({
    routes:[
        {
            name:'index-main',
            path:'/indexMain',
            component:IndexMain,
        },
        {
            name:'ReadNews',
            path:'/read-news',
            component: ReadNews,
            props:true
        },
        {
            name:'UserRegister',
            path:'/register',
            component:UserRegister
        },
        {
            name:'NewsManager',
            path:'/newsManager',
            component:NewsManager,
            meta:{
                permissions:[1]
            }
        },
        {
            name:'NewsAdd',
            path:'/newsAdd',
            component:NewsAdd
        },
        {
            name:'NewsEdit',
            path:'/newsEdit',
            component:NewsEdit,
            props:true
        },
        {
            name:'TopicManager',
            path:'/topicManager',
            component:TopicManager
        }
    ]
})

export default router